{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy,datetime,random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_fitness(genes):\n",
    "    return genes.count(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Chromosome:\n",
    "    def __init__(self, genes, fitness):\n",
    "        self.Genes = genes\n",
    "        self.Fitness = fitness"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "def display(candidate, startTime):\n",
    "    timeDiff = datetime.datetime.now() - startTime\n",
    "    print(\"{}...{}\\t{:3.2f}\\t{}\".format(\n",
    "        ''.join(map(str, candidate.Genes[:15])),\n",
    "        ''.join(map(str, candidate.Genes[-15:])),\n",
    "        candidate.Fitness,\n",
    "        timeDiff))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "def mutate(parent,idxlist):\n",
    "    childGenes = parent.Genes[:]\n",
    "    while True:\n",
    "        index = random.randrange(0, len(parent.Genes),1)\n",
    "        if index in idxlist:\n",
    "            pass\n",
    "        else:\n",
    "            break\n",
    "    newGene, alternate = random.sample([0,1], 2)\n",
    "    childGenes[index] = alternate if newGene == childGenes[index] else newGene\n",
    "    fitness = get_fitness(childGenes)\n",
    "    return (Chromosome(childGenes, fitness),index)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_best():\n",
    "    oneIndex = []\n",
    "    random.seed()\n",
    "    startTime = datetime.datetime.now()\n",
    "    c1 = numpy.random.randint(0,2,(100)).tolist()\n",
    "    bestParent = Chromosome(c1,get_fitness(c1))\n",
    "    if bestParent.Fitness >= 100:\n",
    "        return bestParent\n",
    "    num = 0\n",
    "    while True:\n",
    "        num +=1\n",
    "        child,idx = mutate(bestParent,oneIndex)\n",
    "        if bestParent.Fitness >= child.Fitness:\n",
    "            continue\n",
    "        oneIndex.append(idx)\n",
    "        #display(bestParent,startTime)\n",
    "        if child.Fitness >= 100:\n",
    "            display(child,startTime)\n",
    "            return (child,num)\n",
    "        bestParent = child\n",
    "    display(bestParent,startTime)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "111111111111111...111111111111111\t100.00\t0:00:00.005985\n",
      "100 , 497\n"
     ]
    }
   ],
   "source": [
    "b = get_best()\n",
    "print(b[0].Fitness,\",\",b[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-32-7e1e59f6df6b>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[0mn\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1000\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m     \u001b[0mn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mget_best\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32m<ipython-input-30-ca8dfe3a33d8>\u001b[0m in \u001b[0;36mget_best\u001b[1;34m()\u001b[0m\n\u001b[0;32m     10\u001b[0m     \u001b[1;32mwhile\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     11\u001b[0m         \u001b[0mnum\u001b[0m \u001b[1;33m+=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 12\u001b[1;33m         \u001b[0mchild\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0midx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmutate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mbestParent\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0moneIndex\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     13\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mbestParent\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mFitness\u001b[0m \u001b[1;33m>=\u001b[0m \u001b[0mchild\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mFitness\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     14\u001b[0m             \u001b[1;32mcontinue\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m<ipython-input-13-c548464ba545>\u001b[0m in \u001b[0;36mmutate\u001b[1;34m(parent, idxlist)\u001b[0m\n\u001b[0;32m      2\u001b[0m     \u001b[0mchildGenes\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mparent\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mGenes\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m     \u001b[1;32mwhile\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m         \u001b[0mindex\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mrandom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrandrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mparent\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mGenes\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      5\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mindex\u001b[0m \u001b[1;32min\u001b[0m \u001b[0midxlist\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      6\u001b[0m             \u001b[1;32mpass\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mD:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\random.py\u001b[0m in \u001b[0;36mrandrange\u001b[1;34m(self, start, stop, step, _int)\u001b[0m\n\u001b[0;32m    171\u001b[0m \u001b[1;31m## -------------------- integer methods  -------------------\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    172\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 173\u001b[1;33m     \u001b[1;32mdef\u001b[0m \u001b[0mrandrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstart\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstop\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstep\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0m_int\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mint\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    174\u001b[0m         \"\"\"Choose a random item from range(start, stop[, step]).\n\u001b[0;32m    175\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "n = []\n",
    "for i in range(1000):\n",
    "    n.append(get_best()[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 54., 247., 323., 195., 111.,  40.,  18.,   6.,   3.,   3.]),\n",
       " array([ 197. ,  287.5,  378. ,  468.5,  559. ,  649.5,  740. ,  830.5,\n",
       "         921. , 1011.5, 1102. ]),\n",
       " <a list of 10 Patch objects>)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAP/0lEQVR4nO3df6zddX3H8edrFHFTI0W6prbNLmo3g0ss5IZB9A8GUxGWFRNHIIs2rkn9AzNcTJbqP2gyEkxUNpONWAezGgcyxdEAkWElMf4heFGGpZVwlTLaFHpVRJ2Zs/jeH/dTeii3vT/Ovb3cz30+km/u9/v5fL7n+znffvq63/M533NuqgpJUl9+Z7E7IEmaf4a7JHXIcJekDhnuktQhw12SOrRisTsAcOaZZ9bIyMhid0OSlpQHH3zwx1W1aqq6l0S4j4yMMDY2ttjdkKQlJckTx6tzWkaSOmS4S1KHDHdJ6pDhLkkdMtwlqUOGuyR1yHCXpA4Z7pLUIcNdkjr0kviEqmZnZNtdi3bsfddftmjHljRzXrlLUocMd0nqkOEuSR0y3CWpQ4a7JHXIcJekDhnuktQhw12SOmS4S1KHDHdJ6tC04Z7k5UkeSPJfSR5J8rFWflaS+5OMJ/lSkpe18tPa9nirH1nYpyBJOtZMrtx/DVxUVW8GNgKXJDkf+DhwQ1W9AXgG2NLabwGeaeU3tHaSpJNo2nCvSb9sm6e2pYCLgC+38h3A5W19U9um1V+cJPPWY0nStGY0557klCQPAYeAe4EfAj+rqsOtyX5gbVtfCzwJ0OqfBV4zxWNuTTKWZGxiYmK4ZyFJeoEZhXtVPVdVG4F1wHnAG4c9cFVtr6rRqhpdtWrVsA8nSRowq7tlqupnwH3ABcDpSY58H/w64EBbPwCsB2j1rwZ+Mi+9lSTNyEzullmV5PS2/rvA24C9TIb8u1uzzcAdbX1n26bVf6Oqaj47LUk6sZn8JaY1wI4kp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1EzjybvZmJufij5S/t70jfj7w7MBLsyWtqj5cVeuqaoTJN8y+UVV/BdwHvLs1O/ZcHDlH727tu7h6qaqngCeT/FEruhjYwzIcF0xOx5yf5Pfa/5cj52LZjYtjzHYs3AO8PcnK9mro7a1s6VnsSf+ZLMBbmXw59TDwUFsuZXKOcBfwGPB14IzWPkz+sZAfAt9n8g6CRX8eC3BeLgTubOuvAx4AxoF/B05r5S9v2+Ot/nWL3e95PgcbgbE2Nv4DWLlcxwXwMeAHwG7gC8Bpy2lcALcw+X7Db5h8VbdlLmMB+Ot2XsaB9y3285rr4tcPSFKHlsS0jCRpdgx3SeqQ4S5JHTLcJalDhrskdchwl6QOGe6S1KH/B87Hey9PN/3RAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "451.933"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "numpy.mean(n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
